<?php
/**
 * 公众号页单号相关推送
 * @author lss
 * 2017-05-23
 */
namespace soa\mp\push;

use soa\client;

class openPrint  extends client
{
    /**
     * 服务地址
     * @var string
     */
    public $service_url = 'http://mp.kuaidihelp.com/';

    /**
     * 服务名称
     * @var string
     */
    protected $service_name = 'kuaidihelp_mp';

	//打印任务添加成功通知打印员
	public function addTaskSuccessToPrinter($openid,$taskType = "order"){
		return $this->post("api/push/OpenPrint/addTaskSuccessToPrinter",compact('openid','taskType'));
	}

	//订单打印成功通知打印员
	public function printSuccessToPrinter($openid,$taskType = "order"){
		return $this->post("api/push/OpenPrint/printSuccessToPrinter",compact('openid','taskType'));
	}

	//订单失败成功通知打印员
	public function printFailToPrinter($openid,$errMsg = "",$taskType = "order"){
		return $this->post("api/push/OpenPrint/printFailToPrinter",compact('openid','errMsg','taskType'));
	}

	//订单打印成功通知管理员
	public function printSuccessToManager($openid,$taskType = "order"){
		return $this->post("api/push/OpenPrint/printSuccessToManager",compact('openid','taskType'));
	}

	//订单失败成功通知管理员
	public function printFailToManager($openid,$errMsg = "",$taskType = "order"){
		return $this->post("api/push/OpenPrint/printFailToManager",compact('openid','errMsg','taskType'));
	}

	//订单打印成功通知快递员
	public function printSuccessToCourier($openid,$taskType = "order"){
		return $this->post("api/push/OpenPrint/printSuccessToCourier",compact('openid','taskType'));
	}

	//订单打印成功通知快递员
	public function printOrderListSuccess($openid,$taskId){
		return $this->post("api/push/OpenPrint/printOrderListSuccess",compact('openid','taskId'));
	}

	//打印成功通知
	public function printOrderSuccessToPrinter($info){
		return $this->post("api/push/OpenPrint/printOrderSuccessToPrinter",[
			"orderId" => $info["orderId"] ? : "",
			"agentGuid" => $info["agentGuid"] ? : "",
			"openid" => $info["openid"] ? : "",
			"platform" => $info["platform"] ? : "",
			"printTime" => $info["printTime"] ? : "",
			"first" => $info["first"] ? : "",
			"remark" => $info["remark"] ? : "",
		]);
	}
}